home *** CD-ROM | disk | FTP | other *** search
/ PC-Blue - MS DOS Public Domain Library / PC-Blue MS-DOS Public Domain Library - NYACC.iso / vol029 / memdump.bas (.txt) < prev    next >
Encoding:
GW-BASIC  |  1987-01-11  |  1.1 KB  |  49 lines

  1. 10  REM Program to examine the contents
  2. 20  REM of the memory. Enter the first
  3. 30  REM and last addresses to be displayed.
  4. 40  REM Address and memory contents are
  5. 50  REM both displayed in hexadecimal.
  6. 60  REM ** You can only access 64K on
  7. 70  REM each run, and cannot read over
  8. 80  REM the segment boundries in one
  9. 90  REM run.
  10. 100  REM
  11. 110  REM Author : Eddie Jaeger
  12. 120  REM
  13. 130  REM Written 4/18/82
  14. 140  REM
  15. 141  CLS
  16. 150  INPUT "First,Last Address, in Hex > ",F$,L$
  17. 160  IF LEN(F$)<5 THEN Y$=F$: GOSUB 440: F$=Y$
  18. 170  IF LEN(L$)<5 THEN Y$=L$: GOSUB 440: L$=Y$
  19. 180  S1$ = LEFT$(F$,1)
  20. 190  S1 = VAL("&H"+S1$)
  21. 200  S = S1 * &H1000
  22. 210  X$ = RIGHT$(F$,4)
  23. 220  GOSUB 400
  24. 230  F = X
  25. 240  X$ = RIGHT$(L$,4)
  26. 250  GOSUB 400
  27. 260  L = X
  28. 270  DEF SEG = S
  29. 280  FOR C1 = F TO L STEP 8
  30. 290  C1$ = HEX$(C1)
  31. 300  IF LEN(C1$) < 5 THEN Y$ = C1$: GOSUB 440
  32. 310  A$ = S1$ + RIGHT$(Y$,4)
  33. 320  PRINT USING "\   \"; A$;"      ";
  34. 330  FOR C2 = C1 TO C1 + 7
  35. 340  PRINT USING "\\";HEX$(PEEK(C2));"  ";
  36. 350  NEXT C2
  37. 360  PRINT
  38. 370  NEXT C1
  39. 380  DEF SEG
  40. 390  END
  41. 400  REM CONVERT STRING X$ TO DECIMAL X
  42. 410  X1 = VAL("&H" + X$)
  43. 420  IF X1 < 0 THEN X = 65535+X1 ELSE X = X1
  44. 430  RETURN
  45. 440  REM MAKE Y$ 5 CHARACTERS LONG
  46. 450  Y$ = "0" + Y$
  47. 460  IF LEN(Y$) < 5 THEN GOTO 450
  48. 470  RETURN
  49.